package org.j2se.learn;

import java.lang.reflect.InvocationTargetException;

/**
 * User: 缪凯
 * Date: 12-2-7
 * Time: 下午7:53
 */
public class ClassRef {
    public void go(){
        try {
            Class<Long> a = Long.class;
            Object o = a.getMethod("valueOf" , new Class[]{String.class}).invoke(null , "1");
            Long l = a.cast(o);
            System.out.println(l);
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args){
         ClassRef cr = new ClassRef();
        cr.go();
    }


}
